package com.tfswue.jqr.controller;

import com.tfswue.jqr.config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//合起来等于 @RestController
//@Controller
//@ResponseBody
//标注当前类是一个Controller类，控制层，@ResponseBody注解（返回json数据），@Controller注解（返回页面）组合使用
@RestController
public class HelloController {
//    @Autowired
//    private Config config;
    @Value("${email}")
    private String email;
    @Value("${my1.email}")
    private String my1Email;
    @Value("${city1[0]}")
    private String city1;
    @Value("${sxt[0].mobile}")
    private  String mobile;

    @RequestMapping("/hello")
    public String hello() {
//        return "hello";
        //测试热部署，没有热部署，仍然是之前的hello
        return "hello,改变信息";
    }

    @RequestMapping("/getvalue")
    public String getValue() {
        return email+";"+my1Email+";"+city1+";"+mobile;
    }

    @RequestMapping("/email")
    public String email() {
        return email;
    }
}
